package pl.diagnoser.client.dto;

import com.google.gwt.user.client.rpc.IsSerializable;

public class DiagnoserResultDTO implements IsSerializable, Comparable<DiagnoserResultDTO> {
	
	private long diagnoserResultId;
	private String diagnoserResultName;
	private double diagnoserResultConfidence = 0.0;
	
	public DiagnoserResultDTO() {}
	public DiagnoserResultDTO( String name ) {
		this.diagnoserResultName = name;
	}
	public DiagnoserResultDTO( long id, String name, double confidence ) {
		this.diagnoserResultId = id;
		this.diagnoserResultName = name;
		this.diagnoserResultConfidence = confidence;
	}
	
	public String getDiagnoserResultName() {
		return diagnoserResultName;
	}
	
	public void setDiagnoserResultName( String name ) {
		this.diagnoserResultName = name;
	}
	
	public double getDiagnoserResultConfidence() {
		return this.diagnoserResultConfidence;
	}
	
	public void setDiagnoserResultConfidence( double confidence ) {
		this.diagnoserResultConfidence = confidence;
	}
	
	public long getDiagnoserResultId() {
		return this.diagnoserResultId;
	}
	
	public void setDiagnoserResultId(long diagnoserResultId) {
		this.diagnoserResultId = diagnoserResultId;
	}
	
	public int compareTo(DiagnoserResultDTO result) {
		return Double.compare(diagnoserResultConfidence, result.getDiagnoserResultConfidence());
	}
	
	public String toString() {
		String defect = "<diagnoser_result_name>" + this.getDiagnoserResultName() + "</defect_name>";
		defect += "<diagnoser_result_confidence>" + this.getDiagnoserResultConfidence() + "</defect_confidence>";
		return defect;
	}
}
